package cn.eonshine.cuba.inf.modular.basic.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.eonshine.base.core.base.controller.BaseController;
import cn.eonshine.cuba.inf.common.http.Message;
import cn.eonshine.cuba.inf.modular.basic.service.ITrainTankerService;

/**
 * 控制器
 *
 * @author fengshuonan
 * @Date 2018-07-28 16:23:44
 */
@Controller
@RequestMapping("/trainTanker")
public class TrainTankerController extends BaseController {

    @Autowired
    private ITrainTankerService trainTankerService;

    @Value("${data.isUpdate:0}")
    private int isUpdate;
    
    @RequestMapping(value = "/list")
    @ResponseBody
    public Message list(@RequestBody Message message) {
    	return trainTankerService.queryDataList(message);
    }

    @RequestMapping(value = "/delete")
    @ResponseBody
    public Object delete(@RequestParam Integer trainTankerId) {
        trainTankerService.removeById(trainTankerId);
        return SUCCESS_TIP;
    }

    @RequestMapping(value = "/update")
    @ResponseBody
    public Message update(@RequestBody Message message) {
    	return trainTankerService.changeLsmsUpdate(message, isUpdate);
    }
}
